1. Field of the Invention
The present invention relates to an image-processing device, a method for controlling the image-processing device, a computer program, and a storage medium.
2. Description of the Related Art
In various circumstances, it is desired that digital cameras operate with high speed, allowing a user to operate the digital camera and photograph an image according to the user's will at the moment when the user wants to photograph the image. It is further desired that the digital camera responds to the user so that the user can operate the digital camera without stress. Particularly, in consecutive-photographing mode which allows for the user to photograph images consecutively while a release button is pressed down, a file including data on the photographed images needs to be stored in an external recording medium till a photograph instruction transmitted from the user expires.
In the case where the above-described digital camera is used, when storing the image-data file into the external recording medium, the image-data file is temporarily accumulated in an internal buffer of an internal memory, where the internal buffer is used for storing the image-data file. Then, the image-data file is transmitted from the internal memory to the external recording medium so that the image-data file is written and stored in the external recording medium. However, since the size of the internal buffer is limited, if a large number of images are photographed in the consecutive-photographing mode, the internal buffer overflows with the image data. In that case, the user is required to wait to photograph till the internal buffer has available space.
The consecutive-photographing mode allows the user to photograph images smoothly at the beginning, that is, as long as the number of the photographed images does not exceed a predetermined number, as disclosed in Japanese Patent Laid-Open No. 11-136627 and/or Japanese Patent Laid-Open No. 2003-018537. However, since the data corresponding to several images is written afterwards, the user has to wait to perform photographing during the data-writing period.
Further, if data is written into the external recording medium with low speed and the size of the image-data file is large, the internal buffer overflows with the image data, even though the digital camera is provided, as a system which can store data into the external recording medium at the same time as when the photographing is performed. Subsequently, the user has to wait till the internal buffer has free space for the next image-data file.
Usually, a file-allocation-tables (FAT) system is used, as a file system configured in the external recording medium. The outline of the FAT system is shown in FIG. 2.
A management region 209 including a master-boot recorder (MBR) 201, a boot sector 202, and a FAT 203 is provided in a head region of the FAT system. Basic information relating to the file system is written into the management region 209, where the basic information includes information indicating the data-region size, a cluster size showing the minimum unit of logical data storing performed on storage, and so forth.
A data region 210 is provided next to the management region 209. Usually, a file is stored in the data region 210 including a directory entry 211 and main-body data 213 of the image data file. Here, the directory entry 211 includes information about the image data, where the information indicates the name of the image-data file, the photographing date, the attribute, the start-cluster number of the main-body data 213, the data size, and so forth. A group of the directory entries 211 is referred to as a directory-entry block 212.
Here, an example of a basic method for acquiring a predetermined image file (IMG—0001.JPG) by using the FAT system will be described.
First, the file system finds the directory-entry block 212 including the directory entry 211 of each image-data file, and compares the character string of the name of a file for acquisition and the character strings of the file names of the directory entries 212 in sequence, so as to find the file for acquisition.
If the directory entry 211 including the file for acquisition is detected, the start cluster thereof is acquired. Then, information about a cluster chain relating to what cluster is used by the file for acquisition is obtained by referring to a table of the FAT 203 on the basis of the acquired start cluster. Here, according to the directory entry 211, the start cluster of the image file IMG—0001.JPG is determined to be three. Then, referring to the FAT 203, four clusters including clusters 3, 4, 5, and 6 are used. Since each of the clusters corresponds to 16 kilobytes (KB), the expression 16 KB*4=64 KB holds. Thus, it is identified that the image file IMG—0001.JPG is provided in the clusters 3 to 6, and the part corresponding thereto is read, so that the file for acquisition can be acquired.
On the contrary, when storing a predetermined file into the external recording medium, the predetermined file is opened. When the file is opened, the name of the file (IMG—0001.JPG) is registered with the directory entry 211, so as to store the file. At that time, however, since the start cluster and the file size are not yet determined, the space corresponding thereto is left blank. Next, contents of the file are written into the data region 210. However, the FAT may be updated according to the data size, as required. When the data writing is finished, the file is closed. When the file is closed, information about the start cluster and the file size that was not determined at the time of file opening is written into the directory entry 211 and data writing is performed for the FAT 203.
Thus, when storing a file, data writing for the directory entry 211 (file opening), data writing for the data region 210, and data writing for the directory entry 211 and data writing for the FAT 203 (file closing) are performed. That is to say, four separate data writing operations are required to write the data file corresponding to a single image into the external recording medium.
Therefore, when photographing is performed over N times in the consecutive-photographing mode, the number of data writing operations required to be performed is at least N×4 times. Data can be written into the external recording medium with high speed as long as the regions of the external recording medium are provided consecutively. When writing a file into the external recording medium, however, the data-write positions are often scattered. Namely, the data writing is performed for each of the directory entry 211, the FAT 203, and the data region 210, which causes overhead, so as to specify the data-write positions (remapping) while processing is performed in the external recording medium.
Accordingly, it is desired to reduce the number of writing data into an external recording medium when an image-data file is stored into the external recording medium in consecutive-photographing mode, so that data can be written into a file system with efficiency.